Conditions | 1 |
Total Lines | 10 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {CommandHandler} from '@nestjs/cqrs'; |
||
16 | |||
17 | public async execute(command: UploadFileCommand): Promise<string> { |
||
18 | const {uploadedFile} = command; |
||
19 | |||
20 | const fileName = await this.fileStorage.upload(uploadedFile); |
||
21 | const file = await this.fileRepository.save( |
||
22 | new File(fileName, uploadedFile.size, uploadedFile.mimetype) |
||
23 | ); |
||
24 | |||
25 | return file.getId(); |
||
26 | } |
||
28 |